home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / cclib / include / setjmp.h < prev    next >
C/C++ Source or Header  |  1995-11-16  |  861b  |  37 lines

  1. /*    setjmp.h    */
  2. /*  PMTG - created April 10th 1990 */
  3. #ifndef SETJMP_H
  4. #define SETJMP_H 1
  5. /*
  6.    The layout of jmp_buf variable after a call to setjump
  7.    in this implementation is:
  8.      Element    Contents
  9.       0     return address
  10.       1     D2
  11.       2     D3
  12.       3     D4
  13.       4     D5
  14.       5     D6
  15.       6     D7
  16.       7     A2
  17.       8     A3
  18.       9     A4
  19.      10     A5 - frame pointer
  20.      11     A6 - used as library base pointer
  21.      12     A7 - stack pointer
  22.  
  23.    NOTE: the setjmp and longjmp routines do not fully comply with ANSI C.
  24.      To do so would require saving the state of all local variables
  25.      (ok not to save register variables) at the time of the call to
  26.      setjmp and restore them when longjmp is called. This is left as an
  27.      exercise for the gentle reader...
  28.  
  29. */
  30. typedef unsigned long jmp_buf[13];
  31.  
  32. int setjmp(jmp_buf env);
  33. void longjmp(jmp_buf env, int return_code);
  34.  
  35. #endif
  36.  
  37.